package bb.lanxing.lib.devices.core.ble;

import android.os.Handler;
import android.os.Looper;
import android.os.Message;
import android.util.Log;

import androidx.annotation.NonNull;

//import bb.lanxing.util.Log;

public class GattClientHandler extends Handler {
    AbsBleDevice mClientRef;

    public GattClientHandler(AbsBleDevice absBleDevice, Looper looper) {
        super(looper);
        this.mClientRef = absBleDevice;//AbsBleDevice wangsm
    }

    @Override
    public void handleMessage(@NonNull Message message) {
        AbsBleDevice absBleDevice = this.mClientRef;
        Log.d("wangsm_bt", " GattClientHandler,handleMessage ");
        if (absBleDevice == null) {
            Log.d("wangsm_bt", " GattClientHandler,handleMessage,absBleDevice is null,return ");
            return;
        }
      //  Log.d("wangsm_bt", " GattClientHandler,handleMessage,absBleDevice handle the message what " + message.what);
      //  Log.d("wangsm_bt", " GattClientHandler,handleMessage,absBleDevice handle the message obj " + message.obj);
        try {
            absBleDevice.handleMessage(message);
        } catch (Exception e) {
            absBleDevice.e(e);
        }
    }
}
